<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="dwz" uri="http://www.lyjuan.cn/dwz/tags" %>

<div class="pageContent">
    <form method="post" action="<dwz:url url="role/addRole"/>" class="pageForm"
          onsubmit="return validateCallback(this, customDialogAjaxDone(true, 'role_roleList'));">
        <div class="pageFormContent" layoutH="58">
            <div class="unit">
                <label>名称：</label>
                <input type="text" name="name" class="required" tabindex="1" style="width:200px;"/>
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">提交</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>

</div>

<script>
    /**
     * 根据请求 action 地址生成标识
     */
    var genRelByUrl = function (url) {
        //if (!url) return true;
        if (url)
            url = url.replace(/\//g, '_');

        document.getElementById('rel').value = url;
    };

    /**
     * 显示导航属性
     */
    var showNav = function () {
        $('#isnavUnit').show();
        $('#isnavUnit input').click();
        $('#relUnit').show();
        genRelByUrl(document.getElementById('actionurl').value);
        $('#sortUnit').show();
    };

    /**
     * 隐藏导航属性
     */
    var hideNav = function () {
        $('#isnavUnit').hide();
        $('#isnavUnit input').removeAttr('checked');

        $('#relUnit').hide();
        $('#relUnit input').val('');

        $('#sortUnit').hide();
        $('#sortUnit input').val(100);
    };
</script>